]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/power: Always show real percentage in battery label
authorPrajna Sariputra <putr4.s@gmail.com>
Thu, 1 Apr 2021 09:20:29 +0000 (20:20 +1100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 27 Apr 2021 19:04:34 +0000 (21:04 +0200)
We currently display the percentage as "100%" if the battery state is
"fully charged", but the actual capacity may be lower than that.

Just show the real percentage, which is consistent with Settings.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3393

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1787>

js/ui/status/power.js

index 0e8471fdfa64bff9f2ca0a8f8ff91b76af50f3a9..304f68d47ec6718536a57b60b05771850c9b42a8 100644 (file)
@@ -134,11 +134,7 @@ class Indicator extends PanelMenu.SystemIndicator {
         this._item.icon.fallback_icon_name = fallbackIcon;
 
         // The icon label
-        let label;
-        if (this._proxy.State == UPower.DeviceState.FULLY_CHARGED)
-            label = _("%d\u2009%%").format(100);
-        else
-            label = _("%d\u2009%%").format(this._proxy.Percentage);
+        const label = _('%d\u2009%%').format(this._proxy.Percentage);
         this._percentageLabel.text = label;
 
         // The status label